package com.cloudptt.wp.ui.views;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.LinearLayout;

import com.cloudptt.api.product.log.Log;
import com.cloudptt.wp.R;
import com.cloudptt.wp.ui.views.listener.DialListener;
import com.cloudptt.wp.ui.views.listener.OpAction;


public class MulSelectedOpLayout extends LinearLayout implements OnClickListener{

	public static final String TAG = "PTTLayout";
	private Context context = null;
	private OpAction listener;

	public MulSelectedOpLayout(Context context) {
		this(context, null);
		// TODO Auto-generated constructor stub
		this.context = context;
	}

	public MulSelectedOpLayout(Context context, AttributeSet attrs) {
		this(context, attrs, 0);
		// TODO Auto-generated constructor stub
		this.context = context;
	}

	public MulSelectedOpLayout(Context context, AttributeSet attrs, int defStyleAttr) {
		this(context, attrs, defStyleAttr, 0);
		// TODO Auto-generated constructor stub
		this.context = context;
	}

	public void setDialListener(DialListener listener) {
//		if(mDialLayout != null)
//		{
//			mDialLayout.setDialListener(listener);
//		}
	}

	public MulSelectedOpLayout(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
		super(context, attrs, defStyleAttr, defStyleRes);
		// TODO Auto-generated constructor stub
		this.context = context;
		Log.d(TAG, "PTTLayout new");

		LayoutInflater.from(context).inflate(R.layout.layout_msg_mul_selected_op, this);
//		mDialLayout = (DialLayout)findViewById(R.id.diaLy);
//		mDialLayout.setVisibility(View.GONE);
		Button forwardMulBtn = (Button)findViewById(R.id.forwardMulBtn);
		forwardMulBtn.setOnClickListener(this);
		Button deleteMulBtn = (Button)findViewById(R.id.deleteMulBtn);
		deleteMulBtn.setOnClickListener(this);
		Button cancelBtn = (Button)findViewById(R.id.cancelBtn);
		cancelBtn.setOnClickListener(this);
	}

	public void setOpAction(OpAction listener){
//		mDiaIv.setImageResource(resId);
		this.listener = listener;
	}

	@Override
	public void onClick(View view) {
		// TODO Auto-generated method stub
		if(listener != null)
		{
			listener.doAction(view.getId());
		}
	}

}
